<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
  <title>筛选器测试</title>
  <link rel="stylesheet" type="text/css" href="reset.css">
</head>
<style>
  h3 {
    line-height: 50px;
    font-size: 20px;
    text-align: center;
  }
  #pickerDateId2 ,
  #pickerDateId {
    width: 80%;
    height: 50px;
    border: 1px solid #ccc;
    border-radius: 5px;
    line-height: 50px;
    margin: 50px auto;
    text-align: center;
    font-size: 20px;
  }
</style>
<body>
  <h3>Picker</h3>
  <div id="pickerDateId">选择日期</div>
  <div id="pickerDateId2">选择日期</div>
  <script src="../dist/picker.min.js"></script>
  <script src="../dist/calendar.js"></script>
  <!-- <script src="../dist/picker_date.js"></script> -->

  <!-- <script src="../src/date/calendar.js"></script> -->
  <script src="../src/date/picker_date.js"></script>
  <script type="text/javascript">
    pickerDate({
      _min: [1900,3,1], //最小日期
      val: [2000,1,1],
      _max: [2100,12,31], // 最大日期
      el: 'pickerDateId', // DOM ID
      /*  // 回调参数
      c:{
            leapMonth:0, // 闰月 月份 没有 为0 如果有 月份最大 13
            name:"农历",
            rawData: true, // true 表示 农历是选中值 阳历是 计算值 [防止计算错误 校验字段]
            value:[1910,10,9]
        },
        l:{
            name:"阳历",
            value:[1910,11,10]
        }
      }
      */
      callback: function (_d){
        var str = '农历:' + _d.c.value.join('-');
        var str2 = '阳历:' + _d.l.value.join('-');
        var _str = '';
        if(_d.c.rawData){
          _str = str;
        }else{
          _str = str2;
        }
        document.getElementById('pickerDateId').innerHTML = _str;
        console.log(_d);
      }
    });
    pickerDate({
      _min: [1901,5,5],
      val: [1905,8,8],
      _max: [1906,9,9],
      el: 'pickerDateId2',
      callback: function (_d){
        var str = '农历:' + _d.c.value.join('-');
        var str2 = '阳历:' + _d.l.value.join('-');
        if(_d.c.rawData){
          _str = str;
        }else{
          _str = str2;
        }
        document.getElementById('pickerDateId2').innerHTML = _str;
        console.log(_d);
      }
    });
  </script>
</body>
</html>
